<template>
  <Buildings :buildings="buildings.filter(i => i.publicareatype === 4)" @ok="onSelectBuilding" />
</template>
<script>
// 选择桩基
import Buildings from './Buildings'
export default {
  name: 'Piles',
  components: { Buildings },
  props: { buildings: { type: Array, default: () => [] } },
  methods: {
    onSelectBuilding(data) {
      const item = data.building
      const position = { buildingId: item.fid, shortName: item.fnameL2, pileName: item.fnameL2 }
      this.$emit('ok', { pile: item, position })
    }
  }
}
</script>
